import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '@/views/Login/loginIndex'
import Layout from '@/views/Layout/layoutIndex'
import Home from '@/views/Home/homeIndex'
import Mine from '@/views/Mine/mineIndex'
import Search from '@/views/Search/searchIndex'
import SearchResult from '@/views/Search/searchResult'
import ArticleDetail from '@/views/ArticleDetail/articleDetail'
import UserEdit from '@/views/UserEdit/userEdit'
import Chat from '@/views/Chat/chatIndex'
import Video from '../views/Video/VideoView'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/layout/home'
  },
  {
    path: '/login',
    component: Login
  },
  {
    path: '/layout',
    component: Layout,
    redirect: '/layout/home',
    children: [
      {
        path: 'home',
        component: Home
      },
      {
        path: 'mine',
        component: Mine
      }
    ]
  },
  {
    path: '/search',
    component: Search
  },
  {
    path: '/search_result/:keyword',
    component: SearchResult
  },
  {
    path: '/article_detail/:art_id',
    component: ArticleDetail
  },
  {
    path: '/user_edit',
    component: UserEdit
  },
  {
    path: '/chat',
    component: Chat
  },
  {
    path: '/video',
    component: Video
  }
]

const router = new VueRouter({
  routes
})

export default router
